package com.bilin.coin;

import android.content.Intent;
import android.graphics.Color;
import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
import android.view.KeyEvent;
import android.view.View;
import android.view.WindowManager;
import android.widget.ImageView;

import androidx.appcompat.app.ActionBar;
import androidx.appcompat.widget.Toolbar;

import com.gyf.immersionbar.ImmersionBar;
import com.bilin.coin.common.base.BaseAppCompatActivity;

import org.greenrobot.eventbus.EventBus;
import org.greenrobot.eventbus.Subscribe;
import org.greenrobot.eventbus.ThreadMode;

import butterknife.BindView;


/**
 * Created by pundix002 on 2018/5/5.
 */

public class StartPageActivity extends BaseAppCompatActivity {
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        ImmersionBar.with(this)
                .navigationBarColor(R.color.white)
                .navigationBarEnable(true)
                .init();

    }

    @Override
    protected void initView() {

    }

    @Override
    protected boolean isSetStatusBarColor() {
        return false;
    }

    @Override
    protected void initData() {
        new Handler().postDelayed(new Runnable() {
            @Override
            public void run() {
                jumpMain();
            }
        }, 300);
    }

    boolean isJumpMain = false;

    private void jumpMain() {
        Intent itMain = new Intent(StartPageActivity.this, MainActivity.class);
        startActivity(itMain);
        isJumpMain = true;
        finish();
    }


    @Override
    protected int getLayoutId() {
        return 0;
    }

    @Override
    public boolean isShowToolBar() {
        return false;
    }


    @Override
    public boolean onKeyDown(int keyCode, KeyEvent event) {
        if (keyCode == KeyEvent.KEYCODE_BACK) {
        }
        return true;
    }

    @Subscribe(threadMode = ThreadMode.MAIN)
    public void update(Object o) {
        EventBus.getDefault().removeStickyEvent(o);
    }
}
